<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Chart</title>
    <!-- 引入echarts.js 5.4.3 -->
    <script type="text/javascript" src="https://npm.elemecdn.com/echarts/dist/echarts.js"></script>
</head>
<body>
<div id="myChart" style="width: 800px; height: 400px"></div>
</body>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('myChart'));

    // 指定图表的配置项和数据
    var option = {
        // 标题
        title: {
            text: '7天气温折线图'
        },
        xAxis: {
            type: 'category',
            data: [
                (% for day in dateList %)
                    '(( day ))',
                (% endfor %)
            ]
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name: '最高温度',
                data: [
                    (% for temp in maxTempList %)
                        '(( temp ))',
                    (% endfor %)
                ],
                type: 'line',
                lineStyle: {
                normal: {
                  color: 'red',
                  width: 4,
                    }
                },
                label: {
                    show: true,
                    position: 'bottom',
                    textStyle: {
                      fontSize: 20
                    }
                },
            },
            {
                name: '最低温度',
                data: [
                    (% for temp in minTempList %)
                        '(( temp ))',
                    (% endfor %)
                ],
                type: 'line',
                lineStyle: {
                normal: {
                  color: 'blue',
                  width: 4,
                    }
                },
                label: {
                    show: true,
                    position: 'bottom',
                    textStyle: {
                      fontSize: 20
                    }
                },
            },
        ]
    };

    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</html>